package 笔试.Hand;


public class Demo {
    //关注点一
    public static volatile Demo user = null;

    public static Demo getInstance() {
        if (user == null) {
            synchronized (Demo.class) {
                if (user == null) {
                    synchronized (user) {
                        user = new Demo();
                    }
                }
            }
        }

        return user;//已经实例化过了
    }
}